
package simple3;

import java.io.*;
import java.util.*;

import org.apache.log4j.*;

import simple1.*;

/**
 * 測試 Log4j , 將 log 輸出到 file
 * 
 * Copyright: Copyright (c) 2002-2007<br>
 * Company: E885 工作室<br>
 * 
 * @author Eric Gau E-mail: gau168.gau@msa.hinet.net
 * @version 1.0
 */
public class TestLog4jSimple3
{
	public TestLog4jSimple3() throws IOException
	{
		Properties properties = new Properties();

		InputStream inputStream = TestLog4jSimple1.class.getClassLoader().getResourceAsStream( "simple3/Simple3Log4j.properties" );

		properties.load( inputStream );

		PropertyConfigurator.configure( properties );

		Logger logger = Logger.getLogger( "e885" );

		logger.debug( "Hello Log4j for debug" );
		logger.info( "Hello Log4j for info" );
	}

	public static void main( String[] args )
	{
		try
		{
			new TestLog4jSimple3();
		}
		catch( IOException ex )
		{
			ex.printStackTrace();
		}
	}
}
